package com.itheima.stream;

import java.util.ArrayList;
import java.util.stream.Stream;

public class StreamDemo04 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("zhang");
        list.add("wang");
        list.add("lisi");
        list.add("zhao");
        ArrayList<String> list2 = new ArrayList<>();
        list2.add("zhang");
        list2.add("wang");
        list2.add("lisi");
        list2.add("zhao");
//        list.stream().limit(2).forEach(s -> System.out.println(s));
        Stream<String> stream1 = list.stream();
        Stream<String> stream2 = list2.stream();
        //Stream.concat(stream1,stream2).forEach(s -> System.out.println(s));
        Stream<String> stream3 = Stream.concat(stream1, stream2);
//        stream3.distinct().forEach(s -> System.out.println(s));
        list.stream().skip(2).forEach(s -> System.out.println(s));
    }
}
